<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m190312_011743_ADD_FIELD_USER
 */
class m190312_011743_ADD_FIELD_USER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {   

        $this->addColumn('{{user}}', 'nation', Schema::TYPE_INTEGER. "(1) DEFAULT '1' COMMENT '国家' AFTER company ");
        $this->addColumn('{{supplier}}', 'nation', Schema::TYPE_INTEGER. "(1) DEFAULT '1' COMMENT '国家' AFTER remark ");

        $this->addColumn('{{product}}', 'product_type', Schema::TYPE_INTEGER. "(1) DEFAULT '1' COMMENT '团队类别' AFTER customer_code ");

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m190312_011743_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190312_011743_ADD_FIELD_USER cannot be reverted.\n";

        return false;
    }
    */
}
